# -*- coding: utf-8 -*-
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase

import random
import datetime

from filmsite.models import Category
from filmsite.models import Video
from filmsite.models import Url

class SimpleTest(TestCase):
    def test_basic_addition(self):
        """
        Tests that 1 + 1 always equals 2.
        """
        self.assertEqual(1 + 1, 2)

class CategoryTest(TestCase):
#    def test_list(self):
#        category = Category()
#        list = category.get_list()
#        for item in list:
#            print item
    pass

class VideoTest(TestCase):
#    def test_get_lastest_list(self):
#        video = Video()
#        list = video.get_lastest_videos(3)
#        for item in list:
#            print item
            
#    def test_get_hots(self):
#        video = Video()
#        list = video.get_hots_by_hits(2, 10)
#        for item in list:
#            print item

#    for i in range(1000000):
#        video = Video()
#        category = Category.objects.get(pk=random.randint(5, 55))
#        video.category = category
#        video.title = 'title' + str(i)
#        video.director = 'director' + str(i)
#        video.actor = 'actor' + str(i)
#        video.serial = str(random.randint(1, 500))
#        video.update_time = datetime.datetime.now()
#        video.hits = random.randint(0, 10000)
#        print i
#        video.save()
    pass

class UrlTest(TestCase):
    def test_get_urls(self):
        url = Url()
        list = url.get_urls(1)
        for item in list:
            print item
    pass
